match command {
Ok(ExitStatus(0)) => (),
- Ok(ExitStatus(i)) | Ok(ExitSignal(i)) => {
+ Ok(ExitStatus(i)) => {
handle_error(CliError::new("", i as uint), &mut shell(false))
}
+ Ok(ExitSignal(i)) => {
+ let msg = format!("subcommand failed with signal: {}", i);
+ handle_error(CliError::new(msg, 1), &mut shell(false))
+ }
Err(_) => handle_error(CliError::new("No such subcommand", 127), &mut shell(false))
}
}
fn process(args: Vec<String>) -> (String, Vec<String>) {
let mut args = Vec::from_slice(args.tail());
- let head = args.shift().unwrap_or("--help".to_string());
+ let head = args.remove(0).unwrap_or("--help".to_string());
(head, args)
}
-use std::collections::HashMap;
use std::vec::Vec;
use core::{Source, SourceId, SourceMap, Summary, Dependency, PackageId, Package};
use util::{CargoResult, ChainError, Config, human};
use std::collections::HashMap;
use std::fmt;
-use serialize::{Encodable, Encoder};
use util::graph::{Nodes,Edges};
use core::{
use core::{Package, Target};
use util;
use util::hex::short_hash;
-use util::{CargoResult, Fresh, Dirty, Freshness, Config};
+use util::{CargoResult, Fresh, Dirty, Freshness};
use super::job::Job;
use super::context::Context;